package com.yyx.app1.My_function.Controls.MyAppointment;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yyx.app1.Data.My.Appointment_Data;
import com.yyx.app1.R;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by Administrator on 2015/10/25.
 */
@EViewGroup(R.layout.item_appointmentlistview)
public class ItemView_Appointment extends LinearLayout {
    private Context context;

    @ViewById
    TextView zhuangtai,number,time,name,project,phone;

    public ItemView_Appointment(Context context) {
        super(context);
        this.context = context;
    }

    public ItemView_Appointment(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.context = context;
    }

    public ItemView_Appointment(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
    }

    public void bind(Appointment_Data data)
    {
        if (data.getStatus()== Appointment_Data.Appointment_Data_Type.End)
            zhuangtai.setText("结束");
        else if (data.getStatus() == Appointment_Data.Appointment_Data_Type.Appointment)
            zhuangtai.setText("预约");
        number.setText(data.getNumber());
        time.setText(data.getTime());
        name.setText(data.getUserName());
        project.setText(data.getProject());
        phone.setText(data.getPhone());
    }
}
